package es.capgemini.extjsplugin.core;

import java.io.File;
import java.util.List;

import org.eclipse.jdt.core.IPackageFragment;

import es.capgemini.extjsplugin.ui.ExtendedField;
/**
 * Clase base para generar ficheros y nuevas clases java
 * @author Lisandro Medrano
 *
 */
public abstract class JavaFileGenerator {
	protected String DAO_URL = "";
	protected String DTO_URL = "";
	protected String MODEL_URL = "";
    protected String package_url = "";
    protected String package_name = "";
    protected String package_base = "";
    protected String class_name="";
    protected List<ExtendedField> camposIncluir;
    protected IPackageFragment packageFragment;
    
    /**
     * Crea la estructura de directorios sobre la cual se van a generar los ficheros
     */
    protected void crearDirectorios(){
    	//Creamos la estructura de src/
		File dir_package=new File(package_url+"/dao");
		dir_package.mkdirs();        
        DAO_URL = dir_package.getAbsolutePath();
        
        dir_package = new File(package_url + "/dao/impl");
        dir_package.mkdirs();
        
        dir_package = new File(package_url + "/dto");
        dir_package.mkdirs();
        DTO_URL = dir_package.getAbsolutePath();
        
        dir_package = new File(package_url + "/model");
        dir_package.mkdirs();
        MODEL_URL =dir_package.getAbsolutePath();
    }
    
    
}
